package com.wulin.library.service;

import com.wulin.library.entity.Book;
import com.wulin.library.repository.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {

    @Autowired
    private BookMapper bookMapper;

    public List<Book> getAllBook(){
        return bookMapper.getAllBook();
    }

    public Book getBookById(Integer bookId) {
        return bookMapper.getBookById(bookId);
    }

    public void insertBook(Book book) {
        bookMapper.insertBook(book);
    }

    public void deleteBook(Integer bookId) {
        bookMapper.deleteBook(bookId);
    }
}
